The Let's Play Archive

SHENZHEN I/O

by Quackles

Part 9: Story: All the Parts!

All the Parts!



Carl came by and dumped a bunch of datasheets on my desk. It’s the rest of the garden-variety parts that Longteng likes to use: two more variants of the MC#### line, some memory chips, a bunch of logic gates (one per chip casing? There’s no bulk deal? Really?) and something called a ‘Digital I/O Expander’, which apparently lets you control three 100/0 (on/off) outputs from one XBus (digital I/O) port.

I also got Carl to explain exactly what Joe does! Turns out "Product Manager" is a nice way way of saying "Sales". It explains a lot, especially Joe's super-excited attitude. He's definitely a people person.

Indirectly, this explains what David does, as well. My first guess was mostly on the money - if "Product Manager" is "Sales", then "International Product Manager" is... the same, but focusing on what Western audiences would like, I guess. I wonder what sort of stuff they'll come up with?

Anyway, back to the new parts.

Microcontrollers

The biggest present in this whole package is the MC6000. It's basically the MC4000's big brother - space for 14 lines of code (a pretty respectable amount, honestly), a second register (dat), and two extra digital I/O (XBus) pins!! It costs 5¥ a shot instead of 3¥, but it's pretty worth it.





There is one catch, though: all those arithmetic instructions I explained in the last Corner still only target acc - and there's no 'swap' instruction or anything that reverses the contents of the two registers. So using MCs for math, even MC6000s, will still be cumbersome.

There's also a variant version of the MC4000 called the MC4000X. It costs the same, but the 4000X has four digital I/O pins (x0-x3) rather than two simple (p0, p1) and two digital (x0, x1).




Memory Chips

I've got two types of memory chips available to me: the 100P-14 (read/write) and the 200P-14 (read-only). They each hold 14 values, and basically behave about like you'd expect for memory - you tell the chip where in its storage you want to read or write data, then write or read values in/out as appropriate. Both are ¥2 each.



There are a few wrinkles, though. The first is that the 100P starts blank, and you have to get data into it by writing it at runtime. Meanwhile, the 200P is set up with values in my simulator, and then its contents are fixed forever after - you can only read data out of it.



The second wrinkle is that both the 100P and 200P have "auto-incrementing address pointers". This is a nice way of saying that if you write to or read from a specific memory cell, your next read or write will automatically target the next cell in the memory chip (wrapping around, of course).

I'm not sure how useful and/or annoying this will be, so I'll give people updates once I have to use one chip or the other.


Logic Gates

There's some logic gate chips, which look like they mostly work with simple I/O (so they're using 0 for OFF (binary 0) and 100 for ON (binary 1)). They're all ¥1 each. I'm gonna let the datasheet do the talking about what exactly each one does, for the most part.





One cool thing about these chips: the AND, OR, and XOR gates have an extra output (the one with the dot) that gives the opposite value to what the gate would normally give out. It feels like it'd save on having to buy extra NOT gates to reverse outputs, at least!

I imagine these'd be useful for any sort of job where you have to play around with binary 'signal math' - stuff like "This output is ON only when these other two outputs are ON", that sort of thing.


Digital I/O Expander

So this was an animal new to me, but reading the datasheet, I can see how it could be useful. It basically lets you control (or read) 3 simple I/O signals from one digital I/O port - and I get the feeling that someday, I'll be happy to pay ¥1 for this rather than ¥3 for a new MC with two more simple I/O pins.

 

Come to think of it, you could probably use this to coordinate a series of three or more MCs together, as long as the ones on the simple I/O side were only sending one bit of information to the MC on the XBus end. I should make a note of this...


P.S: I noticed some of you had questions about the parts earlier - with this infodump, I'm feeling more prepared to answer those now!

idhrendur posted:

And these chips are really about a dollar each? From what I can recall from the datasheets of some microcontrollers I've used in the past couple years, that seems pricy for the feature set. But maybe they've got some features I haven't seen or are ultra-low power or something.

TooMuchAbstraction posted:

I'm surprised that such a simple and limited chip has two analog I/O pins. Usually you only get digital on something like this.

@idhrendur - It did seem pretty pricey to me, but you have to remember that exchange rates have been volatile over the past few years. For example, back in, say, 2018, 3¥ was about $0.45 US - but here in 2026, well... ¯\_(ツ)_/¯
On top of that, there's some benefits to these MCs that aren't obviously apparent. One is that they apparently consume next to no power while sleeping, which is pretty impressive in itself - that, and their simple I/O pins can handle and emit surprisingly high voltages for microelectronics (if provided with appropriate power sources). I have no clue how they do it.

@TooMuchAbstraction, I'm guessing my musings above about the simple I/O pins might be why the MC line is so popular. Of course, they did say on the MC4000 datasheet that popular demand had gotten them to start making the MC4000X, so I'm not entirely sure what to think...

NGDBSS posted:

Though to clarify, does this language allow for complex calls within an operation? As it stands it looks like the above operation requires a few steps, and depending on whether they can be nested or not would change what one can do.

[...to swap values] in the case of microcontrollers (such as here) there's always the XOR swap algorithm or its variants.

@NGDBSS - No nesting of instructions, unfortunately. It would be nice, but it doesn't look like MCs are much for indirection and recursion.
And XOR swap would be great if I had anything that looked like XOR, or any binary operation! I get that decimalized MCs are easier to use in some ways, but I still have to wonder how they got so popular here...

Aesculus posted:

Also does your boss know you've spent three hours on solitaire just today?

@Aesculus - You don't tell Jie, and I won't tell Jie. 😓